package com.douxg.learning.springboot.scheduled;

import org.springframework.context.annotation.Configuration;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.scheduling.annotation.Scheduled;

import java.util.concurrent.TimeUnit;

/**
 * @ClassName job1
 * @Description TODO
 * @Author douxg
 * @Date 2019/12/12 14:30
 * @Version 1.0
 */
@Configuration
@EnableScheduling
public class job2 {
    @Scheduled(fixedDelayString = "10")
    public void run() throws Exception {
        System.out.println("job2" + Thread.currentThread().getName());
        TimeUnit.SECONDS.sleep(5);
        throw new Exception("job2");
    }
}
